﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Xiaov.SmartWeb.Model.Statistical.Select
{
    public class MonthSelect_XD:ISelect
    {
        public string DefaultValue
        {
            get;
            set;
        }

        public List<System.Web.UI.WebControls.ListItem> ListItems
        {
            get;
            set;
        }

        public void DataBind(string dw, string tn, string nf, string yf)
        {
            ListItems = new List<System.Web.UI.WebControls.ListItem>();
            for (decimal month = 1; month <= 12; month++)
            {
                ListItems.Add(new System.Web.UI.WebControls.ListItem( month + "月 - 上旬", (month + 0.10M).ToString()));
                ListItems.Add(new System.Web.UI.WebControls.ListItem( month + "月 - 中旬", (month + 0.20M).ToString()));
                ListItems.Add(new System.Web.UI.WebControls.ListItem( month + "月 - 下旬", (month + 0.30M).ToString()));
            }            
            decimal f =Convert.ToDecimal(Convert.ToInt16((DateTime.Now.Day-1)/10)+1)*0.10M;
            if (f >= 0.30M) f = 0.30M;
            DefaultValue = (Convert.ToDecimal(System.DateTime.Now.Month) + f).ToString();
        }
        
    }
}
